from dataclasses import dataclass


@dataclass
class Node:
    val: int
    name: str = 'defualt'

    def __and__(self, other):
        return '别想&我'

    def __add__(self, other):
        return Node(self.val + other.val, self.name + ' ' + other.name)

    def __lt__(self, other):
        return self.val < other.val


    def __eq__(self, other):
        return self.val == other.val


a = Node(5, 'Yangliu')
b = Node(1)
c = Node(4)
d = Node(3, name='Zhangnina')
list1 = [a, b, c,d]
list1.sort()
print(list1)
list1.reverse()
print(list1)